package com.frame.service;

import com.frame.utils.JavaMailUtils;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.function.Consumer;

@Component
@Service
public class KafkaService{

//    @Autowired
//    JavaMailUtils javaMailUtils;
//
//    @KafkaListener(topics = "Test5")
//    public void consumer(ConsumerRecord<String,String> record, Acknowledgment acknowledgment){
//        String value = record.value();
//        System.out.println("收到消息"+value);
//        javaMailUtils.send("1399426606@qq.com",value);
//    }




}
